package org.example.test;
import java.io.File;
public class DeleteFile {
 
    public static boolean deleteDir(String path){
        File file = new File(path);
        File[] list = file.listFiles();
        for(File f:list){
            if(f.isDirectory()){
                deleteDir(f.getPath());
            }else{
                f.delete();
            }
        }
        return file.delete();

    }
 
    public static void main(String[] args) {
        String path = "C:\\Users\\buejee\\Desktop\\test";
        deleteDir(path);
    }
}